package com.jnpf.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description: 流程外部接口枚举
 * @author: duanxu
 * @create: 2025-01-13 14:53
 **/
@Getter
@AllArgsConstructor
public enum FlowApiEnum {

    SIMPLE("发起流程","/api/workflow/open/simple"),
    REVOKE("撤回流程","/api/workflow/open/revoke"),
    CANCEL("终止流程","/api/workflow/open/cancel"),
    DELETE("删除流程","/api/workflow/open/delete"),
    AUDIT("重新提交流程","/api/workflow/open/audit"),
    LOG("操作日志","/api/workflow/open/log"),
    WAIT("代办流程","/api/workflow/open/waitList"),
    DONE("已办流程","/api/workflow/open/doneList"),
    COPY("抄送流程","/api/workflow/open/copyTaskList"),
    LAUNCH("发起的流程","/api/workflow/open/launchList"),
    MONITOR("发起的流程","/api/workflow/open/monitorList"),
    TEMPLATE("流程模板列表", "/api/workflow/open/template/list"),
    ;

    private String type;

    private String path;

    public static FlowApiEnum getByPath(String path) {
        for (FlowApiEnum value : FlowApiEnum.values()) {
            if (value.getPath().equals(path)) {
                return value;
            }
        }
        return null;
    }

}
